package com.eastfair.auth.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.annotation.annotation.dictionary.DictionaryField;
import com.eastfair.annotation.annotation.vo.VoInfo;
import com.eastfair.auth.entity.Organization;
import com.eastfair.annotation.model.BaseVoGroupClass;
import com.eastfair.demand.auth.OrganizationVoGroupClass;
import com.eastfair.demand.auth.UserAccountVoGroupClass;
import com.eastfair.jwt.model.AuthInfo;
import com.eastfair.projectcore.vo.MenuVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

/**
 * <p>
 * 实体类
 * 用户账户信息
 * </p>
 *
 * @author ligang
 * @since 2021-07-27
 */
@Data
@ApiModel(value = "UserAccountVo", description = "用户账户信息")
public class UserAccountVo  implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long id;

    /**
     * 手机国家区号
     */
    @ApiModelProperty(value = "手机国家区号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String countryCode;

    /**
     * IP地址
     */
    @ApiModelProperty(value = "IP地址")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String ipAddr;


    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private String name;


    /**
     * 手机区号
     */
    @ApiModelProperty(value = "手机区号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.getByIdLead.class})
    private String mobileCountryCode;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {OrganizationVoGroupClass.all.class})
    private String mobile;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String email;

    /**
     * 是否是观众 1是 0否
     */
    @ApiModelProperty(value = "是否是观众 1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isVisitor;

    /**
     * 是否是主办 1是 0否
     */
    @ApiModelProperty(value = "是否是主办 1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isSponsor;

    /**
     * 是否是展商 1是 0否
     */
    @ApiModelProperty(value = "是否是展商 1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isActor;

    /**
     * 是否是员工 1是 0否
     */
    @ApiModelProperty(value = "是否是员工 1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isEmployee;

    /**
     * 是否是游客 1是 0否
     */
    @ApiModelProperty(value = "是否是游客 1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isTourist;

    /**
     * 是否是游客 翻译
     */
    @ApiModelProperty(value = "是否是游客 1是 0否")
//    @DictionaryField(type="ENABLED_LIST")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String isTouristText;


    /**
     * 是否完成完善信息：1是；0否
     */
    @ApiModelProperty(value = "是否完成完善信息：1是；0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isCompleteInfo;

    /**
     * 是否设置密码 1是 0否
     */
    @ApiModelProperty(value = "是否设置密码 1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isSetPassword;


    /**
     * 角色信息
     */
    @ApiModelProperty(value = "角色信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.register.class,UserAccountVoGroupClass.login.class,UserAccountVoGroupClass.getByIdLead.class,UserAccountVoGroupClass.querySimpleByIds.class})
    private List<RoleVo> roleVoList;

    /**
     * 角色信息
     */
    @ApiModelProperty(value = "角色信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.register.class,UserAccountVoGroupClass.login.class,UserAccountVoGroupClass.getByIdLead.class,UserAccountVoGroupClass.querySimpleByIds.class})
    private List<String> roleNameList;


    @ApiModelProperty(value = "用户角色ID集合")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.login.class,UserAccountVoGroupClass.getByIdLead.class,UserAccountVoGroupClass.querySimpleByIds.class})
    private List<Long> roleIds;

    /**
     * 菜单信息
     */
    @ApiModelProperty(value = "菜单信息")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.getByIdLead.class})
    private List<MenuVO> menuVOList;


    /**
     * 权限字符 集合
     */
    @ApiModelProperty(value = "权限字符")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.getByIdLead.class})
    private List<String> permissionList;


    /**
     * token令牌
     */
    @ApiModelProperty(value = "token令牌")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.login.class})
    private AuthInfo authInfo;


    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long tenantId;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long subsystemId;

    /**
     * 公司id
     */
    @ApiModelProperty(value = "公司id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long companyId;

    /**
     * 展商id
     */
    @ApiModelProperty(value = "展商id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long exhibitorId;

    /**
     * 观众id
     */
    @ApiModelProperty(value = "观众id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long visitorId;


    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String headImg;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String nickName;
    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isEnabled;

    @ApiModelProperty(value = "用户组织名称集合")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.pageVo.class,UserAccountVoGroupClass.querySimpleByIds.class})
    private List<String> orgNameList;

    @ApiModelProperty(value = "用户组织ID集合")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.pageVo.class,UserAccountVoGroupClass.querySimpleByIds.class})
    private List<Long> orgIds;

    @ApiModelProperty(value = "组织集合")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.pageVo.class,UserAccountVoGroupClass.querySimpleByIds.class})
    private List<Organization> organizationList;

    @ApiModelProperty(value = "用户组织ID字符串")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.pageVo.class})
    private String orgIdStr;


    /**
     * 身份证号
     */
    @ApiModelProperty(value = "身份证号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String idCard;

    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private String realName;


    /**
     * 配套商ID
     */
    @ApiModelProperty(value = "配套商ID")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long matingId;

    /**
     * 主运ID
     */
    @ApiModelProperty(value = "主运ID")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long transportId;

    /**
     * 搭建商ID
     */
    @ApiModelProperty(value = "搭建商ID")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long producerId;

//    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    //时区问题，需要按中国时间 timezone
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "UTC")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private LocalDateTime createTime;






    /**
     * 是否厦门智慧场馆1是 0否
     */
    @ApiModelProperty(value = "是否厦门智慧场馆1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isP;

    /**
     * 是否场馆业务管理系统1是 0否
     */
    @ApiModelProperty(value = "是否场馆业务管理系统1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPVenue;

    /**
     * 是否证件管理系统1是 0否
     */
    @ApiModelProperty(value = "是否证件管理系统1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCertificate;

    /**
     * 是否综合-场馆管理1是 0否
     */
    @ApiModelProperty(value = "是否综合-场馆管理1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCompositeVenue;

    /**
     * 是否综合-主场管理1是 0否
     */
    @ApiModelProperty(value = "是否综合-主场管理1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCompositeCourt;

    /**
     * 是否综合-搭建商管理1是 0否
     */
    @ApiModelProperty(value = "是否综合-搭建商管理1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCompositeProducer;

    /**
     * 是否综合-主运管理1是 0否
     */
    @ApiModelProperty(value = "是否综合-主运管理1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCompositeTransport;

    /**
     * 是否综合-商旅管理1是 0否
     */
    @ApiModelProperty(value = "是否综合-商旅管理1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCompositeTrade;

    /**
     * 是否综合-配套商管理1是 0否
     */
    @ApiModelProperty(value = "是否综合-配套商管理1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCompositeMating;

    /**
     * 是否支付系统1是 0否
     */
    @ApiModelProperty(value = "是否支付系统1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPPay;

    /**
     * 是否展商自服务1是 0否
     */
    @ApiModelProperty(value = "是否展商自服务1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPExhibitorSelf;

    /**
     * 是否餐饮小程序1是 0否
     */
    @ApiModelProperty(value = "是否餐饮小程序1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCateringapp;

    /**
     * 是否餐饮后台服务1是 0否
     */
    @ApiModelProperty(value = "是否餐饮后台服务1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPCatering;

    /**
     * 是否对外门户-场馆后台1是 0否
     */
    @ApiModelProperty(value = "是否对外门户-场馆后台1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPPortalOutVenue;

    /**
     * 是否对外门户-运营后台1是 0否
     */
    @ApiModelProperty(value = "是否对外门户-运营后台1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPPortalOutOperation;

    /**
     * 是否内部门户-工作后台1是 0否
     */
    @ApiModelProperty(value = "是否内部门户-工作后台1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPPortalInWork;

    /**
     * 是否内部门户-工作app1是 0否
     */
    @ApiModelProperty(value = "是否内部门户-工作app1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPPortalInWorkapp;

    /**
     * 是否智慧运营中心系统1是 0否
     */
    @ApiModelProperty(value = "是否智慧运营中心系统1是 0否")
    @TableField(value = "is_p_operation_center")
    @Excel(name = "是否智慧运营中心系统1是 0否")
    private Integer isPOperationCenter;

    /**
     * 是否访客前台系统1是 0否
     */
    @ApiModelProperty(value = "是否访客前台系统1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPVisitorFront;

    /**
     * 是否访客后台系统1是 0否
     */
    @ApiModelProperty(value = "是否访客后台系统1是 0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPVisitorBack;

    /**
     * 是否超级管理员 1是0否
     */
    @ApiModelProperty(value = "是否超级管理员 1是0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isAdmin;

    /**
     * 是否超级管理员1是0否
     */
    @ApiModelProperty(value = "是否超级管理员1是0否")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isSuperAdmin;

    /**
     * 主场ID
     */
    @ApiModelProperty(value = "主场ID")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Long courtId;

    /**
     * 是否主账号
     */
    @ApiModelProperty(value = "是否主账号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    private Integer isPrimaryAccount;

    /**
     * 性別FEMALE女  MALE男 UNKNOW未知
     */
    @ApiModelProperty(value = "性別 1男 0女")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.all.class})
    @DictionaryField(type="CONTACT_GENDER")
    private String gender;


    /**
     * 是否是负责人
     */
    @ApiModelProperty(value = "是否是负责人")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isLeader;


    /**
     * 密码失效时间
     */
    @ApiModelProperty(value = "密码失效时间")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "UTC")
    private LocalDateTime pwdOutTime;

    /**
     * 密码是否临近过期
     */
    @ApiModelProperty(value = "密码是否临近过期")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {BaseVoGroupClass.all.class})
    private Integer isNearOutTime;


    /**
     * 账户所属系统
     */
    @ApiModelProperty(value = "账户所属系统")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {UserAccountVoGroupClass.pageVo.class})
    private List<String> systemSceneList;

//    @ApiModelProperty(value = "创建时间")
//    @TableField(value = "create_time", fill = FieldFill.INSERT)
//    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
////    @JsonSerialize(using  = LocalDateTimeSerializer2.class)
//    protected LocalDateTime createTime;
}
